package com.code.day18;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class Demo04Colletions {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"小王","小张","小李","小赵","小钱");
        System.out.println(list);
        Collections.shuffle(list);
        System.out.println(list);

        ArrayList<String> list2 = new ArrayList<>();
        list2.add("c.举头望明月");
        list2.add("b.疑是地上霜");
        list2.add("d.低头思故乡");
        list2.add("a.床前明月光");
        Collections.sort(list2);
        System.out.println(list2);
    }
}
